package fun.qu_an.minecraft.mini_games_helper.client.mixin;

import net.minecraft.client.option.SimpleOption;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;

@Mixin(targets = "net/minecraft/client/option/GameOptions$3")
public class GameOptions$3Mixin {
	@Redirect(method = "accept(Ljava/lang/String;Lnet/minecraft/client/option/SimpleOption;)V",
		at = @At(value = "INVOKE", target = "Lnet/minecraft/client/option/SimpleOption;getValue()Ljava/lang/Object;"))
	private <T> T onGetValue(SimpleOption<T> instance) {
		return instance.value; // 这里必须直接获取，因为getValue被重定向了
	}
}
